package com.gugee.ins.common.dal.service.statistics.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gugee.ins.common.dal.mapper.statistics.InsStBloggerIncomeMapper;
import com.gugee.ins.common.dal.service.statistics.InsStBloggerIncomeDao;
import com.gugee.ins.common.model.mysql.statistics.InsStBloggerIncome;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * InsStBloggerIncomeDaoImpl
 * @author Huangxin
 */
@Slf4j
@Service
public class InsStBloggerIncomeDaoImpl extends ServiceImpl<InsStBloggerIncomeMapper, InsStBloggerIncome> implements InsStBloggerIncomeDao {

    /**
     * 根据uid 获取收入统计信息
     * @param uid
     * @return
     */
    @Override
    public List<InsStBloggerIncome> findIncomeByUid(long uid) {
        return baseMapper.findIncomeByUid(uid);
    }

    /**
     * 根据uid 删除收入统计信息
     * @param uid
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteByUid(long uid){
        baseMapper.deleteByUid(uid);
    }
}
